﻿<%@ Page Title="" Language="C#" MasterPageFile="~/View/MasterPage.Master" AutoEventWireup="true" CodeBehind="AddUser.aspx.cs" Inherits="GRC_TPE_WebApp.View.Private.User.AddUser" %>

<%--Title--%>
<asp:Content ID="Content1" ContentPlaceHolderID="title" runat="server">
</asp:Content>

<%--Content--%>
<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="server">
    <fieldset>
        <legend>Ajouter un nouvel utilisateur : </legend>
                <table>
                    <tr>
                        <asp:ValidationSummary ID="addUserSummary" runat="server"
                        headerText="Il y a des erreurs sur la page :" />
                    </tr>
                    <tr>
                        <td>Nom : </td>
                        <td>
                            <asp:TextBox ID="addUserLastName" runat="server" />

                            <%--Validator--%>
                            <asp:RequiredFieldValidator ID="lastnameRequired" runat="server"
                            ControlToValidate="addUserLastName"
                            ErrorMessage="Le nom est requis."> *
                            </asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>Prénom : </td>
                        <td>
                            <asp:TextBox ID="addUserFirstName" runat="server" />

                            <%--Validator--%>
                            <asp:RequiredFieldValidator ID="firstnameRequired" runat="server"
                            ControlToValidate="addUserFirstName"
                            ErrorMessage="Le prénom est requis."> *
                            </asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>Nom d'utilisateur : </td>
                        <td>
                            <asp:TextBox ID="addUserUsername" runat="server" />

                            <%--Validator--%>
                            <asp:RequiredFieldValidator ID="usernameRequired" runat="server"
                            ControlToValidate="addUserUsername"
                            ErrorMessage="Le nom d'utilisateur est requis."> *
                            </asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>Mot de Passe : </td>
                        <td>
                            <asp:TextBox ID="addUserPassword" runat="server" TextMode="Password" />

                            <%--Validator--%>
                            <asp:RequiredFieldValidator ID="passwordRequired" runat="server"
                            ControlToValidate="addUserPassword"
                            ErrorMessage="Le mot de passe est requis."> *
                            </asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>Confirmer le Mot de Passe : </td>
                        <td>
                            <asp:TextBox ID="addUserConfirmPassword" runat="server" TextMode="Password" />

                            <%--Validator--%>
                            <asp:RequiredFieldValidator ID="confirmPasswordRequired" runat="server"
                            ControlToValidate="addUserConfirmPassword"
                            ErrorMessage="La confirmation du mot de passe est requise."> *
                            </asp:RequiredFieldValidator>

                            <%--Validator : Compare les mots de passe--%>
                            <asp:CompareValidator ID="CompareValidator1" runat="server"
                            ControlToValidate="addUserPassword"
                            ControlToCompare="addUserConfirmPassword"
                            ErrorMessage="Les mots de passe sont différents." />
                        </td>
                    </tr>
                    <tr>
                        <td>Type : </td>
                        <td>
                            <asp:DropDownList ID="addUserType" runat="server">
                                <asp:ListItem>Utilisateur</asp:ListItem>
                                <asp:ListItem>Administrateur</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td><asp:Button ID="addUserButton" runat="server" Text="Ajouter un utilisateur" OnClick="addUserButton_Click"/></td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="addUserErrorMessage"  runat="server" />
                        </td>
                    </tr>
                </table>
    </fieldset>
</asp:Content>

<%--Footer--%>
<asp:Content ID="Content6" ContentPlaceHolderID="footer" runat="server">
</asp:Content>
